package com.um.jdy.app.shop.controller;

import com.um.jdy.app.base.manager.KeywordManager;
import com.um.jdy.common.shop.entity.vo.KeywordVO;
import com.um.springboot.starter.orm.entity.Response;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 控制器：搜索热门关键词
 */
@RestController
@RequestMapping("/api/v1/shop/keyword")
@Api(tags = "基础", description = "搜索热门关键词")
public class KeywordController {

    @Autowired
    KeywordManager keywordManager;

    @ApiOperation("查询搜索热门关键词")
    @GetMapping("hot")
    public Response<List<KeywordVO>> getHotKeyword(){
        return Response.success(keywordManager.getHotKeyword());
    }

    @ApiOperation("查询搜索输入框关键词")
    @GetMapping("search")
    public Response<KeywordVO> getSearchKeyword(){
        return Response.success(keywordManager.getSearchKeyword());
    }

}
